#ifndef __MYTHREAD_H_
#define __MYTHREAD_H_

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include "comdef.h"

class CMyThread
{
public:
	CMyThread(void);
	~CMyThread(void);

	bool StartThread(void);
	void WaitForStop(void);

#ifdef _WIN32
	static DWORD WINAPI WorkThread(void *param)
	{
		return ((CMyThread *)param)->ThreadProc();
	}
#endif

private:
	unsigned long ThreadProc(void);

protected:
	virtual void ThreadProcMain(void) = 0;

protected:
#ifdef _WIN32
	unsigned long	m_ulThreadID;
	HANDLE			m_hThread;
	HANDLE			m_hEvent;
#endif
};
#endif
